import { myAble } from '../utils'

import Home from '../pages/Home'
import Login from '../pages/Login'
import Detail from '../pages/Detail'

// import Homes from '../pages/home/Homes'
// import App from '../pages/home/App'
// import My from '../pages/home/My'

// const a = import('../utils')

// import Homes from myAble(() => import("../pages/home/Homes"), Loading)

// function Loading() {
//     return <div>
//         loading~~~
//     </div>
// }

const Homes = myAble(() => import("../pages/home/Homes"))
const App = myAble(() => import("../pages/home/App"))
const My = myAble(() => import("../pages/home/My"))

export default [
    {
        to: "/home",
        from: "/"
    },
    {
        path: "/home",
        com: Home,
        children: [
            {
                path: "/home/homes",
                com: Homes
            },
            {
                path: "/home/app",
                com: App
            },
            {
                path: "/home/my",
                com: My
            }
        ]
    },
    {
        path: "/detail",
        com: Detail
    },
    {
        path: "/login",
        com: Login
    }
]